<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin:0;
            padding:0;
        }
        #box{
            height:100px;
            width:100px;
            border:5px solid red;
            overflow: auto;
        }
    </style>
</head>
<body>
    <div id="box">11111111111111111111111111111111111</div>
    <script>
        //2
        // scrollWidth:滚动的宽度 滚动内容没有超出盒子就跟clientWidth一样；
                    // 滚动内容超出盒子就按照实际的超出宽度
        // scrollHeight:滚动的高度
       console.log(box.scrollWidth);
       console.log(box.clientWidth);
       console.log(box.offsetWidth);
    </script
</body>
</html>